load(
    "//tools:defaults.bzl",
    "extract_tokens",
    "markdown_to_html",
    "ng_module",
    "ng_test_library",
    "ng_web_test_suite",
    "sass_binary",
    "sass_library",
)

package(default_visibility = ["//visibility:public"])

ng_module(
    name = "tooltip",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "**/*.spec.ts",
        ],
    ),
    assets = [
        ":tooltip_scss",
    ] + glob(["**/*.html"]),
    deps = [
        "//src/cdk/coercion",
        "//src/cdk/overlay",
        "//src/cdk/portal",
        "//src/material/core",
    ],
)

sass_library(
    name = "tooltip_scss_lib",
    srcs = glob(["**/_*.scss"]),
    deps = [
        "//src/material/core:core_scss_lib",
    ],
)

sass_binary(
    name = "tooltip_scss",
    src = "tooltip.scss",
    deps = [
        "//src/material/core:core_scss_lib",
    ],
)

ng_test_library(
    name = "tooltip_tests_lib",
    srcs = glob(
        ["**/*.spec.ts"],
        exclude = [
            "**/*.e2e.spec.ts",
        ],
    ),
    deps = [
        ":tooltip",
        "//src/cdk/a11y",
        "//src/cdk/bidi",
        "//src/cdk/keycodes",
        "//src/cdk/overlay",
        "//src/cdk/platform",
        "//src/cdk/testing/private",
        "@npm//@angular/animations",
        "@npm//@angular/platform-browser",
        "@npm//rxjs",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [
        ":tooltip_tests_lib",
    ],
)

markdown_to_html(
    name = "overview",
    srcs = [":tooltip.md"],
)

extract_tokens(
    name = "tokens",
    srcs = [":tooltip_scss_lib"],
)

filegroup(
    name = "source-files",
    srcs = glob(["**/*.ts"]),
)
